<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <title>已逾期列表</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <link href="../../vendors/iconfonts/mdi/css/materialdesignicons.min.css" type="text/css" rel="stylesheet"/>
    <link href="../../vendors/css/vendor.bundle.base.css" type="text/css" rel="stylesheet"/>
    <link href="../../css/style.css" type="text/css" rel="stylesheet"/>
    <link href="../../node_modules/jqvmap/dist/jqvmap.min.css" type="text/css" rel="stylesheet"/>

    <script src="../../vendors/js/vendor.bundle.base.js"></script>
    <script src="../../vendors/js/vendor.bundle.addons.js"></script>
    <script src="../../vendors/js/Calendar.js"></script>
    <script src="../../js/off-canvas.js"></script>
    <script src="../../js/misc.js"></script>

</head>

<body>


<section>

    <div id="u19955" class="ax_default" data-left="39" data-top="19" data-width="167" data-height="16">

        <!-- Unnamed (Rectangle) -->
        <div id="u19956" class="ax_default label">
            <div id="u19956_div" class="">

            </div>

            <div id="u19956_text" class="text ">

                <p class="col-sm-6 col-md-4 col-lg-3">
                    <i class="mdi mdi-home"></i>
                    <span style="text-decoration:none;color:#333333;">首页/催收管理</span><span style="text-decoration:none;">/即将到期列表</span></p>
            </div>
        </div>
    </div>

    <div class="box" >
        <div class="card-body" style="padding-top: 7px;">

            <form id="MyForm"  class="form-inline" method="post" >
                <input id="currentPageNo" type="hidden" name="currentPageNo" value="1"/>
                <input  class="form-control mb-2 mr-sm-2" type="text" name="userName" th:value="${userName}" placeholder="姓名"/>
                <input  class="form-control mb-2 mr-sm-2" type="text" name="phoneNumber" th:value="${phoneNumber}" placeholder="手机号"/>
                <input  class="form-control mb-2 mr-sm-2" type="text" name="loanId" th:value="${loanId}" placeholder="借款编号"/>
                <input  class="form-control mb-2 mr-sm-2" type="text" name="ContractId"  th:value="${ContractId}" placeholder="合同号"/>
            <!--    <select class="form-control mb-2 mr-sm-2" name="riskClassification" th:value="${riskClassification}">
                    <option value="0">&#45;&#45;请选择风险分类&#45;&#45;</option>
                    <option value="正常类">正常类</option>
                    <option value="关注类">关注类</option>
                    <option value="次级类">次级类</option>
                    <option value="可疑类">可疑类</option>
                    <option value="损失类">损失类</option>
                </select>-->
                <input  class="form-control mb-2 mr-sm-2" type="text" name="riskClassification"  th:value="${riskClassification}" placeholder="风险分类"/>
                <button id="submit"  type="button" class="btn btn-gradient-primary btn-sm" style="margin: -3px 20px 0px 10px  ">查询</button>
                <!--
                                      <button type="button" class="btn btn-outline-secondary btn-sm" style="margin-top: -3px">高级查询</button>
                -->
            </form>
        </div>
    </div>

    <div class="box2">

        <p style="font-size:18px;"><span style="font-family:'FontAwesome';font-weight:400;text-decoration:none;"></span><span style="font-family:'Arial Normal', 'Arial';font-weight:400;font-size:12px;text-decoration:none;"> </span><span style="font-family:'微软雅黑';font-weight:400;font-size:12px;text-decoration:none;">数据列表</span></p>

    </div>

    <div id="u19876" class="ax_default _默认样式">
        <div id="u19876_div" class="">

        </div>
        <div id="u19876_text" class="text " style="display:none; visibility: hidden">
            <p></p>
        </div>
    </div>
    <div class="col-lg-12 stretch-card">
        <div class="card">
            <div class="card-body" style="padding-top: 0px">

                <table class="table table-bordered" >
                    <thead>
                    <tr>

                        <!--   <th>

                            <input type="checkbox"  />
                            全选


                            </th>-->
                        <th>
                            借款编号
                        </th>
                        <th>
                            姓名
                        </th>
                        <th>
                            合同号
                        </th>
                        <th>
                            当前期次
                        </th>
                        <th>
                            应收本金
                        </th>
                        <th>
                            应收利息
                        </th>
                        <th>
                            借款管理费
                        </th>
                        <th>
                            贷款类型
                        </th>
                        <th>
                            本期还款日
                        </th>
                        <th>
                            逾期天数
                        </th>
                        <th>
                            风险分类
                        </th>
                        <th>
                            催收次数
                        </th>
                        <th>
                            状态
                        </th>
                        <th>
                            操作
                        </th>
                    </tr>
                    </thead>
                    <tbody >
                    <tr th:each="od:${qryAllPageList}">




                        <!--
                                             <td> <input type="checkbox"  /></td>
                        -->
                        <!--
                                                 <input type="hidden" th:attr="id=${user.userId }+'_userId'" th:value="${user.userId}"/>
                        -->

                        <td th:text="${od.loan_id}"></td>
                        <td th:text="${od.userName}"></td>
                        <td th:text="${od.contractId}"></td>
                        <td th:text="${od.currentperiod}"></td>
                        <td th:text="${od.overduePrincipal}"></td>
                        <td th:text="${od.overdueInterest}"></td>
                        <td th:text="${od.loanManagemenFee}"></td>
                        <td th:text="${od.loanType}"></td>
                        <td th:text="${od.currentRepaymentDate}"></td>
                        <td th:text="${od.overdueDays}"></td>
                        <td th:text="${od.riskClassification}"></td>
                        <td th:text="${od.ch.collectionNumber}"></td>
                        <td th:text="${od.repaymentStatus}"></td>
                        <td >
<!--
                            <span><a href="javascript:;" class="userDel" th:onclick="'del(this)'" th:attr="userid=${user.userId }">催收办理</a></span>
-->
                            <button onclick="add();"  type="button" class="btn btn-gradient-primary btn-sm" style="margin: -3px 20px 0px 10px  ">催收处理</button>
                        </td>

                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <div style="display: none;" id="editDiv">
        <form th:action="@{/consumer/add}" method="post">
            <table>
                <input type="hidden" name="userId" id="edit_userId" value="0"/>
                <tr>
                    <td>用户名：</td>
                    <td><input type="text" name="userName" id="edit_userName"/></td>
                </tr>
                <tr>
                    <td>手机号：</td>
                    <td><input type="text" name="phone" id="edit_phone"/></td>
                </tr>
                <tr>
                    <td>地址：</td>
                    <td><input type="text" name="address" id="edit_address"/></td>
                </tr>
                <tr>
                    <td><span>用户角色：</span></td>
                    <td><select name="userRole" id="edit_roleName">
                        <option value="0">--请选择--</option>
                        <option th:each="role:${roleList}"
                                th:value="${role.roleId}"
                                th:text="${role.roleName}"></option>
                    </select></td>
                </tr>
                <tr>
                    <td colspan="2">
                        <button>确定</button>
                    </td>
                </tr>
            </table>
        </form>
    </div>

    <div class="page-bar">
        <ul class="page-num-ul clearfix">
            <li>共<span th:text="${page.totalCount }"></span>条记录&nbsp;&nbsp; <span th:text="${page.pageIndex}"></span>/<span th:text="${page.totalPageCount}"></span> 页</li>
            <button th:onclick="'javascript:pageQry(document.forms[0],1)'" th:if="${page.pageIndex gt 1 }">首页</button>
            <button th:onclick="'javascript:pageQry(document.forms[0],'+${page.pageIndex - 1}+')'"  th:if="${page.pageIndex gt 1 }">上一页</button>

            <button th:onclick="'javascript:pageQry(document.forms[0],'+${page.pageIndex + 1}+')'" th:if="${page.pageIndex lt page.totalPageCount}">下一页</button>
            <button th:onclick="'javascript:pageQry(document.forms[0],'+${page.totalPageCount}+')'" th:if="${page.pageIndex lt page.totalPageCount}">最后一页</button>
            &nbsp;&nbsp;
        </ul>
        <span class="page-go-form"><label>跳转至</label>
             <input type="hidden" id="totalPageCount" th:value="${page.totalPageCount}"/>
             <input type="text" name="inputPage" id="inputPage" class="page-key"/>页
             <button type="button" class="page-btn"
                     th:onClick="'jumpPage(document.forms[0],document.getElementById(\''+inputPage+'\').value)'">GO</button>
		</span>
    </div>

    <script type="text/javascript" src="../../js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="../../layer/layer.js"></script>

    <script type="text/javascript">

        //01.分页查询
        function pageQry(form, pageIndex) {

            $.ajax({
                type:"post",
                url:"/overDue/qryPageAll?currentPageNo="+pageIndex+"",
                data:"page=1",
                success: function(){
                    window.location.href="/overDue/qryPageAll?currentPageNo="+pageIndex;
                   /* $("#Conframe").load("/overDue/qryPageAll?currentPageNo="+pageIndex+"");*/


                },
                error:function () {
                    alert("错误");


                }
            })

        }

        //02.跳转页查询
        function jumpPage(form, jumpPageIndex) {
            //01.数字校验
            var reg = /^[1-9]\d{0,}$/;
            if (!reg.test(parseInt(jumpPageIndex))) {
                alert("请输入合法的数字");
                return;
            }
            //02.范围校验：当前页不能大于总页数
            if (jumpPageIndex > document.getElementById("totalPageCount").value) {
                alert("已经是最后一页!");
                return;
            }
            $.ajax({
                type:"post",
                url:"/overDue/qryPageAll?currentPageNo="+jumpPageIndex+"",
                data:"page=1",
                success: function(){
                    window.location.href="/overDue/qryPageAll?currentPageNo="+jumpPageIndex;
/*
                    $("#Conframe").load("/overDue/qryPageAll?currentPageNo="+jumpPageIndex+"");
*/


                },
                error:function () {
                    alert("错误");


                }
            })
        }


        //新增用户
        function add() {
            layer.open({
                'title': '编辑用户',
                'type': 1,
                'content': $("#editDiv")
            });
        }

        //删除用户
        /*  function del(ele) {
              var $ele = $(ele);
              var userId = $ele.attr('userId');
              $.ajax({
                  url: '//delBlackUser/'+userId+"",
                  type: 'get'
                  data: "",
                  dataType: 'json',
                  success: function (data) {
                      alert("删除成功");

                      if (data.success) {

                          //页面删除行
                          $("#" + userId + "_row").remove();
                      } else {

                          alert("删除失败");
                      }
                  }

              });
          }*/
        //查询
        $("#submit").click(function () {
            alert($("#MyForm").serialize());
            $.ajax({
                type: "post",
                dataType: "text",
                url: "/overDue/qryPageAll?currentPageNo=1",
                data:$("#MyForm").serialize(),
                success: function (data) {
                    alert($("#MyForm").serialize());
                    window.location.href="/overDue/qryPageAll?"+$("#MyForm").serialize();

                   /* $("#Conframe").load("/overDue/qryPageAll?"+$("#MyForm").serialize()+"");*/

                },
                error: function () {
                    alert("错误");


                }


            });
        })





    </script>
</section>
</body>
</html>